package com.cn.kehong.controller;

import com.cn.kehong.api.ILaborAttendRecordService;
import com.cn.kehong.api.ILaborRateService;
import com.cn.kehong.domain.LaborAttendRecord;
import com.cn.kehong.domain.LaborRate;
import com.cn.kehong.utils.CommonUtil;
import com.cn.kehong.utils.JsonResponse;
import com.cn.kehong.utils.QueryForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * 劳率controller
 */
@Controller
@RequestMapping("/laborAttendRecord")
public class LaborAttendRecordController {

    @Autowired
    private ILaborAttendRecordService laborAttendRecordService;

    @RequestMapping("/getLaborAttendRecord/{frontToken}")
    @ResponseBody
    public JsonResponse<LaborAttendRecord> getLaborAttendRecord(String laborId, @PathVariable(value = "frontToken",required = true) String frontToken) throws Exception {
        JsonResponse<LaborAttendRecord> response = new JsonResponse<LaborAttendRecord>();
        LaborAttendRecord record = laborAttendRecordService.getLaborAttendRecord(laborId);
        response.setResult(record);
        response.setSuccess(true);
        return  response;
    }

}
